#include "DirectLOL/gameEngine/eventmanager.h"

EventManager::EventManager()
{
    inputE= new InputEventManager();
}

void EventManager::CheckEvents()
{
    inputE->ResetKeyState();
    inputE->DeStackEvents();

    for(int i=0;i<delegates.size();i++)
    {
        if(delegates.at(i)->end==1)
        {
            delegates.erase(delegates.begin()+i);
        }
        else
        {
            delegates.at(i)->Update();
        }
    }
}

void EventManager::AddEvent(AbstractDelegate * aEvent)
{
    delegates.push_back(aEvent);
}
